<template>
  <div class="pjjl_box">
    <div class="xq_tag_box">
      <div class="xq_tab">{{ name }}</div>
    </div>
    <div class="zx_table_box">
      <el-table :data="tableData" stripe fit>
        <el-table-column prop="year" label="年度"> </el-table-column>
        <el-table-column prop="level" label="资信等级"> </el-table-column>
      </el-table>
      <div class="pagination_bg">
        <el-pagination
          hide-on-single-page
          background
          :pager-count="5"
          layout="prev, pager, next"
          @current-change="handleCurrentChange"
          :current-page="page"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>
        
        <script>
export default {
  data() {
    return {
      tableData: [],
      total: 0,
      page: 1,
      name: "",
    };
  },

  mounted() {
    this.getinfo();
  },
  methods: {
    /**
     * 分页
     * @param {页码} page
     */
    handleCurrentChange(page) {
      // 当分页发生变化时的处理函数
      this.page = page;
      this.getinfo();
    },
    /**
     * 获取列表
     */
    getinfo() {
      let that = this;
      let data = {
        page: that.page,
      };
      that.$http.post("credit/list_history_detail", data).then((res) => {
        if (res.code === 1) {
          that.total = res.data.list.total;
          that.tableData = res.data.list.data;
          that.name = res.data.name;
        } else {
          that.total = 0;
          that.tableData = [];
        }
      });
    },
    //  ==
  },
};
</script>

<style >
.pjjl_box {
  background: #ffffff;
  border-radius: 0.125rem;
  margin: 0.125rem 0.025rem 0.3rem 0.625rem;
  box-shadow: 1px 1px 3px 2px rgba(0, 0, 0, 0.15);
}
.pjjl_box .xq_tag_box {
  border-bottom: solid 0.0375rem #1954a4;
  display: flex;
  align-items: center;
  height: 0.75rem;
  padding-left: 0.25rem;
  box-sizing: border-box;
}
.pjjl_box .xq_tab {
  border-left: solid 0.075rem #1954a4;
  font-size: 0.25rem;
  font-weight: 400;
  color: #1954a4;
  padding-left: 0.2125rem;
  box-sizing: border-box;
}
.pjjl_box .zx_table_box {
  padding: 0.2625rem;
  margin-top: 0.125rem;
}
.pjjl_box .zx_table_box .el-table__header thead th {
  background-color: #1954a4 !important;
  height: 0.2125rem;
  font-size: 0.2rem;
  font-weight: 400;
  color: #ffffff;
  text-align: center;
}
.pjjl_box .zx_table_box .el-table__body-wrapper tbody td {
  text-align: center;
}
.pjjl_box .pagination_bg {
  margin: 2% auto 0;
  text-align: center;
}
.pjjl_box
  .pagination_bg
  .el-pagination.is-background
  .el-pager
  li:not(.disabled).active {
  background-color: #1954a4;
}
</style>
        
      <style scoped>
::v-deep .el-table tr {
  font-size: 0.2rem;
}
</style>